package NGUYENHUUDUC_CTLT_EX_TL;

import java.util.Scanner;

public class ex4 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("Nhap vao thang can xem: ");
		Scanner sc = new Scanner (System.in);
		String tam = sc.nextLine();
		if(tam.isEmpty()== true){
			System.out.println("Can phai nhap thang de xem!");
		}else{
			int iThang = Integer.parseInt(tam);
			System.out.println("Nhap vao nam can xem ");
			tam = sc.nextLine();
		if(tam.isEmpty()==true){
			System.out.println("Xin nhap nam can xem! ");
		}else{
			int iNam = Integer.parseInt(tam);
			switch(iThang){
			case 4:
			case 6:
			case 9:
			case 11:
				System.out.println("Thang"+iThang+"Nam"+iNam+"co"+30+"ngay");
				break;
			case 2:
				if ((iNam % 400 == 0) || (iNam % 4 == 0 && iNam % 100 != 0))
					System.out.println("Tháng" + iThang + "Năm"
							+ iNam + "co" + 29 + "ngày");
				else
					System.out.println("Tháng" + iThang + "Năm"
							+ iNam + "có" + 28 + "ngày"); break;
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
				System.out.println("Thang"+iThang+"Nam"+iNam+"co"+31+"ngay");
				break;
			}
		}
		}
	}
}
